<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class XML_Parser_Simple</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class XML_Parser_Simple</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Simple XML parser class.</p>
<p class="description"><p>This class is a simplified version of XML_Parser.  In most XML applications the real action is executed,  when a closing tag is found.</p><p>XML_Parser_Simple allows you to just implement one callback  for each tag that will receive the tag with its attributes  and CData.</p><p><pre><ol><code><pre><li> <span class="src-inc">require_once </span><span class="src-str">'../Parser/Simple.php'</span><span class="src-sym">;</span></li>
<li>&nbsp;</li>
<li> <span class="src-key">class </span><span class="src-id">myParser </span><span class="src-key">extends </span><a href="../XML_Parser/XML_Parser_Simple.html">XML_Parser_Simple</a></li>
<li> <span class="src-sym">{</span></li>
<li>     <span class="src-key">function </span><span class="src-id">myParser</span><span class="src-sym">(</span><span class="src-sym">)</span></li>
<li>     <span class="src-sym">{</span></li>
<li>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">XML_Parser_Simple</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li>      <span class="src-sym">}</span></li>
<li>&nbsp;</li>
<li>    <span class="src-key">function </span><span class="src-id">handleElement</span><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">, </span><span class="src-var">$attribs</span><span class="src-sym">, </span><span class="src-var">$data</span><span class="src-sym">)</span></li>
<li>     <span class="src-sym">{</span></li>
<li>         <a href="http://www.php.net/printf">printf</a><span class="src-sym">(</span><span class="src-str">'handle %s&lt;br&gt;'</span><span class="src-sym">, </span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li>     <span class="src-sym">}</span></li>
<li> <span class="src-sym">}</span></li>
<li>&nbsp;</li>
<li> <span class="src-var">$p </span>= <span class="src-sym">&amp;</span><span class="src-key">new </span><span class="src-id">myParser</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li>&nbsp;</li>
<li> <span class="src-var">$result </span>= <span class="src-var">$p</span><span class="src-sym">-&gt;</span><span class="src-id">setInputFile</span><span class="src-sym">(</span><span class="src-str">'myDoc.xml'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li> <span class="src-var">$result </span>= <span class="src-var">$p</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
</pre></code></ol></pre></p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Stephan Schmidt &lt;<a href="mailto:schst@php-tools.net">schst@php-tools.net</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_XML_Parser_Simple_php.html">/XML/Parser/Simple.php</a> (line <span class="field">79</span>)
		</p>
		
				
		<pre><a href="../SpikePHPCoverage/PEAR.html">PEAR</a>
   |
   --<a href="../XML_Parser/XML_Parser.html">XML_Parser</a>
      |
      --XML_Parser_Simple</pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$handler" title="details" class="var-name">$handler</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">XML_Parser_Simple</span>
										<a href="#XML_Parser_Simple" title="details" class="method-name">XML_Parser_Simple</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$srcenc</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">'event'</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tgtenc</span> = <span class="var-default">null</span>], <span class="var-type">string</span>&nbsp;<span class="var-name">$tgenc</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#addToData" title="details" class="method-name">addToData</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$data</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#getCurrentDepth" title="details" class="method-name">getCurrentDepth</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#handleElement" title="details" class="method-name">handleElement</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$attribs</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$data</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">boolean|object</span>
										<a href="#reset" title="details" class="method-name">reset</a>
										()
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$handler" id="$handler"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$handler</span>
			 = <span class="var-default">array(<br />        'default_handler'                   =&gt; 'defaultHandler',<br />        'processing_instruction_handler'    =&gt; 'piHandler',<br />        'unparsed_entity_decl_handler'      =&gt; 'unparsedHandler',<br />        'notation_decl_handler'             =&gt; 'notationHandler',<br />        'external_entity_ref_handler'       =&gt; 'entityrefHandler'<br />    )</span>			(line <span class="line-number">110</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Mapping from expat handler function to class method.</p>
	
	
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../XML_Parser/XML_Parser.html#var$handler">XML_Parser::$handler</a></dt>
						<dd>Mapping from expat handler function to class method.</dd>
					</dl>
		
		

</div>
							<h4>Inherited Variables</h4>
				<A NAME='inherited_vars'><!-- --></A>
									<p>Inherited from <span class="classname"><a href="../XML_Parser/XML_Parser.html">XML_Parser</a></span></p>
					<blockquote>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$folding">XML_Parser::$folding</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$fp">XML_Parser::$fp</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$mode">XML_Parser::$mode</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$parser">XML_Parser::$parser</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$srcenc">XML_Parser::$srcenc</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$tgtenc">XML_Parser::$tgtenc</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$_handlerObj">XML_Parser::$_handlerObj</a></span><br>
							</span>
													<span class="var-title">
								<span class="var-name"><a href="../XML_Parser/XML_Parser.html#var$_validEncodings">XML_Parser::$_validEncodings</a></span><br>
							</span>
											</blockquote> 
										
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodXML_Parser_Simple" id="XML_Parser_Simple"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor XML_Parser_Simple</span> (line <span class="line-number">131</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Creates an XML parser.</p>
<p class="description"><p>This is needed for PHP4 compatibility, it will  call the constructor, when a new instance is created.</p></p>
	
	<div class="method-signature">
		<span class="method-result">XML_Parser_Simple</span>
		<span class="method-name">
			XML_Parser_Simple
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$srcenc</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">'event'</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tgtenc</span> = <span class="var-default">null</span>], <span class="var-type">string</span>&nbsp;<span class="var-name">$tgenc</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$srcenc</span><span class="var-description">: source charset encoding, use NULL (default) to use                        whatever the document specifies</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$mode</span><span class="var-description">: how this parser object should work, &quot;event&quot; for                        handleElement(), &quot;func&quot; to have it call functions                        named after elements (handleElement_$name())</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tgenc</span><span class="var-description">: a valid target encoding</span>			</li>
				</ul>
		
		
	</div>
<a name="methodaddToData" id="addToData"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">addToData</span> (line <span class="line-number">292</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">add some string to the current ddata.</p>
<p class="description"><p>This is commonly needed, when a document is parsed recursively.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			addToData
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$data</span><span class="var-description">: data to add</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetCurrentDepth" id="getCurrentDepth"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getCurrentDepth</span> (line <span class="line-number">278</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">get the current tag depth</p>
<p class="description"><p>The root tag is in depth 0.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			getCurrentDepth
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodhandleElement" id="handleElement"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">handleElement</span> (line <span class="line-number">266</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">handle a tag</p>
<p class="description"><p>Implement this in your parser</p></p>
	<ul class="tags">
				<li><span class="field">abstract:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			handleElement
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$attribs</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: element name</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$attribs</span><span class="var-description">: attributes</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$data</span><span class="var-description">: character data</span>			</li>
				</ul>
		
		
	</div>
<a name="methodreset" id="reset"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">reset</span> (line <span class="line-number">175</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reset the parser.</p>
<p class="description"><p>This allows you to use one parser instance  to parse multiple XML documents.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> true on success, PEAR_Error otherwise</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean|object</span>
		<span class="method-name">
			reset
		</span>
				()
			</div>
	
		
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../XML_Parser/XML_Parser.html#methodreset">XML_Parser::reset()</a></dt>
						<dd>Reset the parser.</dd>
					</dl>
		
	</div>
							<h4>Inherited Methods</h4>
				<a name='inherited_methods'><!-- --></a>	
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../XML_Parser/XML_Parser.html">XML_Parser</a></span></p>
					<blockquote>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodXML_Parser">XML_Parser::XML_Parser()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#method__construct">XML_Parser::__construct()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodendHandler">XML_Parser::endHandler()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodfree">XML_Parser::free()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodfuncEndHandler">XML_Parser::funcEndHandler()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodfuncStartHandler">XML_Parser::funcStartHandler()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodparse">XML_Parser::parse()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodparseString">XML_Parser::parseString()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodraiseError">XML_Parser::raiseError()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodreset">XML_Parser::reset()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodsetHandlerObj">XML_Parser::setHandlerObj()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodsetInput">XML_Parser::setInput()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodsetInputFile">XML_Parser::setInputFile()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodsetInputString">XML_Parser::setInputString()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodsetMode">XML_Parser::setMode()</a></span><br>
													<span class="method-name"><a href="../XML_Parser/XML_Parser.html#methodstartHandler">XML_Parser::startHandler()</a></span><br>
											</blockquote>
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../SpikePHPCoverage/PEAR.html">PEAR</a></span></p>
					<blockquote>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodPEAR">PEAR::PEAR()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methoddelExpect">PEAR::delExpect()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodexpectError">PEAR::expectError()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodgetStaticProperty">PEAR::getStaticProperty()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodisError">PEAR::isError()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodloadExtension">PEAR::loadExtension()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodpopErrorHandling">PEAR::popErrorHandling()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodpopExpect">PEAR::popExpect()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodpushErrorHandling">PEAR::pushErrorHandling()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodraiseError">PEAR::raiseError()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodregisterShutdownFunc">PEAR::registerShutdownFunc()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodsetErrorHandling">PEAR::setErrorHandling()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodstaticPopErrorHandling">PEAR::staticPopErrorHandling()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodstaticPushErrorHandling">PEAR::staticPushErrorHandling()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#methodthrowError">PEAR::throwError()</a></span><br>
													<span class="method-name"><a href="../SpikePHPCoverage/PEAR.html#method_PEAR">PEAR::_PEAR()</a></span><br>
											</blockquote>
										
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Fri, 06 Jul 2007 12:51:39 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>